This document contains:
aRt of the figure: visualising your data using R workshop and configuring it a bitImportantly, if something went wrong and you could not install the software, please find me before the workshop starts so we can try to quickly troubleshoot. We cannot afford to waste any time on issues like installation during the workshop.
You must have two pieces of (free) software installed on you laptop before coming to the workshop. Bring your laptop with you. The installation process is very simple. Before you start, make sure your operating system is up to date as well (particularly, there are known conflicts between old versions of R for older Mac OS (pre-El Capitan) and some newer packages).
First and foremost, you need R. If you already have R installed, please still update it to the most recent version (which is done just by downloading the most recent installer and installing). Depending on your operating system, go to:
Download the installer and install (with default options, just keep clicking Next). Run the R once to see that it works (in Windows, Rgui.exe should appear as a shortcut in the start menu and/or desktop; on a Mac, look for the R application in Finder). It should look something like this, depending on your OS:
Good job. Now close R (if it asks to save the workspace: not necessary). Once you get RStudio, there is no need to look at this ugly interface ever again.
While it is completely fine to use R from the command line or the bare-bones R interface application, we are going to use RStudio, which will make using R a lot easier and less of a hassle. It also has nice support for R Markdown, which we will be using. Go to:
Download and install. Run RStudio (again, look for the shortcut in Start Menu/Finder or the desktop).
RStudio is an integrated development environment for R (which is why we had to install that first) - the Console panel on the left is basically the same thing that you saw when you ran “plain” R. But RStudio also features a number of very helpful things that will become apparent in the workshop. RStudio comes with a handy script editor, which we are going to use right away.
Before we do that, we need to quickly change two options in RStudio to make it behave in a more useful way for us (fortunately, the RStudio interface is highly customisable).
Soft-wrap R source file (this will make using the script editor much easier, by wrapping long lines so you won’t have to keep scrolling left and right all the time).Show output inline for all R Markdown documents. This will disable notebook-style plot previews in the script editor and show plots on their own.Almost done! We need to make sure your RStudio and certain packages get along so we can use R Markdown and some more advanced plotting tools in the workshop. During this process, RStudio might need to download a few things - make sure you have internet access.
p=c("igraph", "ggplot2", "plotly", "visNetwork", "wordcloud", "quanteda", "raster", "corrplot", "rmarkdown"); install.packages(p); x=p%in%rownames(installed.packages());if(all(x)){print("Packages installed successfully!")}else{print(paste("Failed to install:", paste(p[!x]), ", try again and make sure you have internet connection."))}
Common issues:
Feel free to close this window now. If all this worked, great! If something did not work here, try restarting RStudio once and redoing the steps. If still no luck, find me beforehand so we can fix this.
As the last step, download the script file for the workshop.
If it downloads as intended, then you should be able to open it with RStudio. If it just opens in the browser as a plain text file when you click the link, instead of downloading, try right-clicking (CTRL+click on a Mac) on the link and selecting Save link as...).
If for some reason it got saved as a .txt file instead - apparently can happen with some browsers: make sure the name of the file ends in .Rmd and not .Rmd.txt - delete the .txt suffix if necessary (on Windows, you may need to enable “show file extensions” in the folder options). After that, double-clicking it should open it in RStudio.
Feel free to browse the script beforehand if you’d like, but also don’t be intimidated by the amount of code there: you will be guided through all the exercises in the workshop (except for the bonus sections, which are meant as additional material to be explored on your own, once you’ve learned the basics).
By the way, these are the sort of things you will be easily able to create after participating in the workshop + following the post-workshop bonus sections. Below the basic plots are interactive ones, try zooming and moving them.